package com.kitten.note.biz.rpc;


import com.kitten.distributed_id_gen.api.DistributedIdGeneratorFeignApi;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

/**
 * RPC服务，用于生成分布式ID
 */
@Component
public class DistributedIdGeneratorRpcService {
    @Resource   // 分布式ID生成器Feign API
    private DistributedIdGeneratorFeignApi distributedIdGeneratorFeignApi;

    /**
     * 生成雪花算法 ID
     *
     * @return
     */
    public String getSnowflakeId() {
        return distributedIdGeneratorFeignApi.getSnowflakeId("test");
    }
}
